package org.lboot.flow.event.system;

import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.lboot.flow.module.work.FlowWork;
import org.lboot.flow.module.work.params.FlowTaskParams;
import org.springframework.context.ApplicationEvent;

import java.time.Clock;

/**
 * @author kindear
 * 流程流转事件
 */
@Slf4j
@Getter
public class FlowProcessEvent extends ApplicationEvent {
    FlowWork oldFlow;
    FlowWork newFlow;

    @Deprecated
    FlowTaskParams taskParams;
    public FlowProcessEvent(Object source,FlowWork oldFlow,FlowWork newFlow,FlowTaskParams taskParams) {
        super(source);
        this.oldFlow = oldFlow;
        this.newFlow = newFlow;
        this.taskParams = taskParams;
    }

    public FlowProcessEvent(Object source,FlowWork oldFlow,FlowWork newFlow) {
        super(source);
        this.oldFlow = oldFlow;
        this.newFlow = newFlow;
    }

    public FlowProcessEvent(Object source, Clock clock) {
        super(source, clock);
    }
}
